package net.zjitc.Utils;
import com.mchange.v2.c3p0.ComboPooledDataSource;

import javax.sql.DataSource;
import java.sql.Connection;
import java.sql.SQLException;


/**
 * Created by hasee on 2017/9/26.
 */
public class C3P0Utils {
    public static ComboPooledDataSource cpds = new ComboPooledDataSource("users");

    public static Connection getConnection(){
        try {
            return cpds.getConnection();
        } catch (SQLException e) {
            e.printStackTrace();
        }
        return null;
    }

    public static DataSource getDataSource(){
        return cpds;
    }


}
